<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
  <style>
	  .layui-form{min-width:800px;}
	  .layui-form-label{ width:20%;}
	  .layui-form-label span{ font-size: 12px; color:gray;}
	  .layui-form-item .layui-input-inline{width: 70%;}
	  .layui-table td, .layui-table th{ text-align: center;}
	  .span10{ width: 100px; height: 22px; line-height: 22px; padding: 2px;}
	  .thischeck_all{ text-decoration: underline; cursor: pointer;}
  </style>
</head>
<body>

<form action="{:url()}" method="post" class="layui-form" lay-filter="component-form-group" onsubmit="return save_form2(this)">
	<input type="hidden" name="catid" value="{$r.catid}" />
  <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">分类名称</label>
      <div class="layui-input-inline">
        <input type="text" name="name" value="{$r.name}" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">是否启用</label>
      <div class="layui-input-inline">
            <div class="layui-col-md12">
              <input type="radio" name="status" value="1" title="启用" {if $r.status==1}checked{/if}/>
              <input type="radio" name="status" value="0" title="禁用" {if $r.status==0}checked{/if}/>
            </div>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">图形验证码</label>
      <div class="layui-input-inline">
            <div class="layui-col-md12">
              <input type="radio" name="verify_code" value="1" title="开启" {if $r.verify_code==1}checked{/if}/>
              <input type="radio" name="verify_code" value="0" title="关闭" {if $r.verify_code==0}checked{/if}/>
            </div>
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">短信验证码<span>开启短信验证码必须勾选mobile字段</span></label>
      <div class="layui-input-inline">
            <div class="layui-col-md12">
              <input type="radio" name="mobile_verify_code" value="1" title="开启" {if $r.mobile_verify_code==1}checked{/if}/>
              <input type="radio" name="mobile_verify_code" value="0" title="关闭" {if $r.mobile_verify_code==0}checked{/if}/>
            </div>
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">提交用户</label>
      <div class="layui-input-inline">
		  <select name="member_group[]" Multiple lay-ignore class="select2" data-tags="true" data-placeholder="不勾选会对游客开放">
			{foreach $memberGroup as $v}
				<option value="{$v.group_id}" {:strstr($r['member_group'],','.$v['group_id'].',')?"selected":""}>{$v.name}</option>
			{/foreach}
		  </select>
      </div>
    </div>	
    <div class="layui-form-item">
      <label class="layui-form-label">同步转发邮箱</label>
      <div class="layui-input-inline">
        <input type="text" name="request_email" value="{$r.request_email}"  placeholder="请输入接收邮件的地址,多个邮箱用逗号隔开，如:123@qq.com,456@164.com,不建议超过2个邮箱，否则用户在提交的时候等待非常慢" autocomplete="off" class="layui-input">
      </div>
    </div>		
    <div class="layui-form-item">
      <label class="layui-form-label">请勾选字段</label>
      <div class="layui-input-inline">


		<div class="widget-content nopadding" style="width:99%; ">
		  <table class="layui-table" style="border-right:1px solid #ccc">
			<thead>
			  <tr>
				<th width="20%;">字段标识</th>
				<th width="20%;">字段名</th>
				<th width="20%;">录入项</th>
				<th width="20%;">必填项</th>
			  </tr>
			</thead>
			<tbody>
				{foreach $table_field as $v}
			  <tr>
				  <td><input type="hidden" name="field_id[]" value="{$v.field_id}"><input type="text" name="field_name[]" value="{$v.name}" class="span10"></td>
				  <td><input type="text" name="field[]" value="{$v.field}" readonly  class="span10"></td>
				  <td class="center"><input type="checkbox" lay-skin="primary" name="is_enter[]" value="{$v.field}" {$v['is_enter_checked']?"checked":""}></td>
				  <td class="center"><input type="checkbox" lay-skin="primary" name="must_enter[]" value="{$v.field}" {$v['must_enter_checked']?"checked":""}></td>                
			  </tr> 
				{/foreach}

			</tbody>
		  </table>
		</div>


      </div>
    </div>	
	

  </div>
  
	<div class="layui-form-item layui-layout-admin" style="margin-top: 30px;">
		<div class="layui-input-block">
		   <div class="layui-footer" style="left: 0;">
			  <button class="layui-btn" type="submit"  lay-filter="component-form-element">立即提交</button>
			  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		  </div>
		</div>
	</div>  
</form>
  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  <!--select2 js start-->
  <link rel="stylesheet" href="/static/select2/select2.css" media="all">
  <script src="/static/select2/select2.js"></script>
  <!--select2 js end-->  
  <script>
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;
	form.render(null, 'component-form-group');
	//模型里选择字段
	$('.select2').select2();
  })
  

  </script>
</body>
</html>